import request from '@/utils/request'

// 查询订单退款列表
export function listRefund(query) {
  return request({
    url: '/admin/SOrder/orderRefundList',
    method: 'get',
    params: query
  })
}

// 查询订单退款详细
export function getRefund(orderRefundId) {
  return request({
    url: '/system/refund/' + orderRefundId,
    method: 'get'
  })
}

// 新增订单退款
export function addRefund(data) {
  return request({
    url: '/system/refund',
    method: 'post',
    data: data
  })
}

// 修改订单退款
export function updateRefund(data) {
  return request({
    url: '/system/refund',
    method: 'put',
    data: data
  })
}

// 删除订单退款
export function delRefund(orderRefundId) {
  return request({
    url: '/system/refund/' + orderRefundId,
    method: 'delete'
  })
}

//修改售后备注
export function saveOrderRefundRemark(orderRefundId,remark){
  const data = {
    orderRefundId,
    remark,
  }
  return request({
    url: '/admin/SOrder/saveRefundOrder',
    method: 'post',
    data: data
  })
}

//修改售后订单不退款原因
export function saveOrderNotRefund(orderRefundId,failMessage,OrderId){
  const data = {
    orderRefundId,
    failMessage,
    OrderId,
  }
  return request({
    url: '/admin/SOrder/saveNotRefundOrder',
    method: 'post',
    data: data
  })
}
